package com.aspose.cells;

class zyt extends zys {
   private zagu[][] a;

   public zyt(zagu[][] var1) {
      this.a = var1;
   }

   int k() {
      return this.a.length;
   }

   int l() {
      return this.a[0].length;
   }

   zagu[] a(int var1) {
      return this.a[var1];
   }

   public Object c() {
      return this.a;
   }

   public Object b(zaay var1) {
      Object[][] var2 = new Object[this.a.length][];

      for(int var5 = 0; var5 < this.a.length; ++var5) {
         zagu[] var3 = this.a[var5];
         if (var3 != null) {
            Object[] var4 = new Object[var3.length];
            var2[var5] = var4;

            for(int var6 = 0; var6 < var3.length; ++var6) {
               if (var3[var6] != null) {
                  var4[var6] = var3[var6].b(var1);
               }
            }
         }
      }

      return var2;
   }

   public int b(zaay var1, int var2) {
      return var2 == 96 || this.a.length <= 1 && this.a[0].length <= 1 ? 0 : 1;
   }

   public zagu e(zaay var1) {
      return this.a[0][0];
   }

   public zahn a(zaay var1, boolean var2) {
      if (this.a.length == 1) {
         zagu[] var3 = this.a[0];
         return (zahn)(var3.length == 1 ? new zaya(var3[0], 6) : new zawg(var3));
      } else {
         return new zawi(this.a);
      }
   }

   public boolean f(zaay var1) {
      return this.a.length == 1 && this.a[0].length == 1;
   }

   public boolean g(zaay var1) {
      return this.a.length == 1;
   }

   public boolean h(zaay var1) {
      return this.a[0].length == 1;
   }

   public zagu a(int[] var1, zaay var2, boolean var3) {
      zagu[] var4 = null;
      int var5;
      if (this.a.length == 1) {
         var1[0] = 1;
         var4 = this.a[0];
      } else {
         var5 = var1[0];
         var1[0] = this.a.length;
         if (var5 >= this.a.length) {
            var1[1] = this.a[0].length;
            return zzb.a;
         }

         var4 = this.a[var5];
      }

      if (var4.length == 1) {
         var1[1] = 1;
         return var4[0];
      } else {
         var5 = var1[1];
         var1[1] = var4.length;
         return (zagu)(var5 >= var4.length ? zzb.a : var4[var5]);
      }
   }

   public zagu a(int[] var1, zaay var2) {
      if (this.a.length == 1) {
         var1[0] = 1;
         return this;
      } else {
         int var3 = var1[0];
         var1[0] = this.a.length;
         return (zagu)(var3 >= this.a.length ? zzb.a : new zyt(new zagu[][]{this.a[var3]}));
      }
   }

   public zagu b(int[] var1, zaay var2) {
      if (this.a[0].length == 1) {
         var1[0] = 1;
         return this;
      } else {
         int var3 = var1[0];
         var1[0] = this.a[0].length;
         if (var3 >= var1[0]) {
            return zzb.a;
         } else {
            zagu[][] var4 = new zagu[this.a.length][];

            for(int var5 = 0; var5 < this.a.length; ++var5) {
               if (this.a[var5] != null) {
                  var4[var5] = new zagu[1];
                  var4[var5][0] = this.a[var5][var3];
               }
            }

            return new zyt(var4);
         }
      }
   }

   public void a(StringBuilder var1, zaay var2) {
      var1.append('{');
      if (this.a != null) {
         char var3 = ';';
         char var4 = ',';
         if (var2 != null && var2.p.v == 14) {
            var3 = '|';
            var4 = ';';
         }

         zagu[][] var5 = this.a;
         int var6 = var5.length;

         for(int var7 = 0; var7 < var6; ++var7) {
            zagu[] var8 = var5[var7];
            if (var8 != null) {
               zagu[] var9 = var8;
               int var10 = var8.length;

               for(int var11 = 0; var11 < var10; ++var11) {
                  zagu var12 = var9[var11];
                  if (var12 != null) {
                     var12.a(var1, var2);
                  }

                  var1.append(var4);
               }

               var1.setLength(var1.length() - 1);
            }

            var1.append(var3);
         }

         var1.setLength(var1.length() - 1);
      }

      var1.append('}');
   }

   public boolean a(zagu var1) {
      if (var1.b() == 6 && var1 instanceof zyt) {
         zyt var2 = (zyt)var1;
         if (this.a != null && this.a.length >= 1) {
            if (var2.a == null || var2.a.length < 1) {
               return false;
            }

            if (this.a.length != var2.a.length) {
               return false;
            }

            for(int var3 = 0; var3 < this.a.length; ++var3) {
               if (!zaaq.a(this.a[var3], var2.a[var3])) {
                  return false;
               }
            }
         } else if (var2.a != null && var2.a.length > 0) {
            return false;
         }

         return true;
      } else {
         return false;
      }
   }

   public zagu b(zagu var1) {
      if (this.a(var1)) {
         return this;
      } else {
         if (this.a != null && this.a.length > 0) {
            for(int var2 = 0; var2 < this.a.length; ++var2) {
               if (this.a[var2] != null && this.a[var2].length > 0) {
                  for(int var3 = 0; var3 < this.a[var2].length; ++var3) {
                     if (this.a[var2][var3] != null) {
                        zagu var4 = this.a[var2][var3].b(var1);
                        if (var4 != null) {
                           return var4;
                        }
                     }
                  }
               }
            }
         }

         return null;
      }
   }
}
